package cn.itsource.ymjs.web.controller;

import cn.itsource.ymjs.entity.CourseType;
import cn.itsource.ymjs.result.JSONResult;
import cn.itsource.ymjs.service.ICourseTypeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author SuperJellyfish
 * @description TODO
 * @date 2022/2/3 16:25
 */
@RestController
@RequestMapping("/courseType")
@Api
public class CourseTypeController {

    @Autowired
    private ICourseTypeService courseTypeService;

    @GetMapping("/treeData")
    public JSONResult getTreeData() {
        List<CourseType> list = courseTypeService.getTreeData();
        return JSONResult.success(list);
    }
}
